<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>课表</title>
	
	<!-- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -->
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<!-- <link media="all" href="/kebiao/Public/Home/css/frozen.css?v=201501248042" rel="stylesheet">
	<link media="all" href="/kebiao/Public/Home/css/parallax.css?v=201501248042" rel="stylesheet">
	<link media="all" href="/kebiao/Public/Home/css/parallax-animation.css?v=201501248042" rel="stylesheet"> -->
	<link media="all" href="/kebiao/Public/Home/css/frozen.css" rel="stylesheet">
	<link media="all" href="/kebiao/Public/Home/css/parallax.css" rel="stylesheet">
	<link media="all" href="/kebiao/Public/Home/css/parallax-animation.css" rel="stylesheet">
	<script type="text/javascript" src="http://www.youziku.com/webfont/FastJS/ef0c4f6471ae42ae9ad376566e027e2f.js"></script>
	
	<style type="text/css">
		html,body{
			width: 100% !important;
			overflow-x:hidden; 
		}
		section[data-id="1"] {
		    background-image:url(/kebiao/Public/Home/img/1.jpg);
		    background-size: cover;
		}
		section[data-id="2"] {
			background-image:url(/kebiao/Public/Home/img/1.jpg);
		    background-size: cover;
		}
		section[data-id="3"] {
		    background-image:url(/kebiao/Public/Home/img/1.jpg);
		    background-size: cover;
		}
		.ui-form-item {
		    height: 74px;
		    font-size: 25px;
		    line-height: 44px;
		    vertical-align: middle;
		    /*padding-right: 40px;*/
		    position: relative;
		    padding-left: 15px;
		    color: white;
		}
		select {
			display: block;
			width: 100%;
			height: 100%;
		}
		.search{
			text-align: center;
			line-height: 74px;
			color: black;
			font-weight: 700;
		}
		.xinqi div{
			width: 80%;
			min-height: 50px;
			margin: 10px auto;
			border-radius: 10px;
			padding:10px 20px;
			font-size: 20px;
			background-color: rgba(255,255,255,0.8);
		}
		
		.container{
			width: 90%;
			min-height: 100px;
			margin: 10px auto;
			border-radius: 10px;
			padding:10px 10px;
			/*font-size: 20px;*/
			background-color: rgba(255,255,255,0.8);
		}

		.lay{
			display: inline-block;
			width: 20%;
			min-height: 15px;
			/*margin: 10px auto;*/
			border-radius: 10px;
			padding:5px 7px;
			font-size: 10px;
			background-color: #FFACD;
			float: left;
			box-sizing:border-box;
		}
		/*.lay div{
			padding:5px 7px;
		}*/

		.ui-loading-wrap {
		    display: -webkit-box;
		    -webkit-box-pack: center;
		    -webkit-box-align: center;
		    text-align: center;
		    height: 40px
		}

		.ui-loading {
		    width: 20px;
		    height: 20px;
		    display: block;
		    background: url(/kebiao/Public/Home/img/loading_sprite.png);
		    -webkit-background-size: auto 20px;
		    -webkit-animation: am-rotate 1s steps(12) infinite
		}

		.ui-loading-bright {
		    width: 37px;
		    height: 37px;
		    display: block;
		    background-image: url(/kebiao/Public/Home/img/loading_sprite_white.png);
		    -webkit-background-size: auto 37px;
		    -webkit-animation: am-rotate2 1s steps(12) infinite
		}

		.ui-loading-wrap .ui-loading {
		    margin: 10px
		}

		.ui-loading-block {
		    position: fixed;
		    top: 0;
		    left: 0;
		    width: 100%;
		    height: 100%;
		    z-index: 9999;
		    display: -webkit-box;
		    -webkit-box-orient: horizontal;
		    -webkit-box-pack: center;
		    -webkit-box-align: center;
		    background: rgba(0, 0, 0, .4);
		    display: none;
		    background: transparent
		}

		.ui-loading-block .ui-loading-cnt {
		    width: 130px;
		    height: 110px;
		    display: -webkit-box;
		    -webkit-box-orient: vertical;
		    -webkit-box-align: center;
		    text-align: center;
		    background: rgba(0, 0, 0, .65);
		    border-radius: 6px;
		    color: #fff;
		    font-size: 16px
		}

		.ui-loading-block .ui-loading-bright {
		    margin: 18px 0 8px
		}

		.ui-loading-block.show {
		    display: -webkit-box !important;
		    /*background-color: white;*/
		    display: box
		}


		@-webkit-keyframes am-rotate {
		    from {
		        background-position: 0 0
		    }
		    to {
		        background-position: -240px 0
		    }
		}

		@-webkit-keyframes am-rotate2 {
		    from {
		        background-position: 0 0
		    }
		    to {
		        background-position: -444px 0
		    }
		}

	</style>

</head>
<body>

	
	<div class="ui-loading-block show" id="loading">
	    <div class="ui-loading-cnt">
	        <i class="ui-loading-bright"></i>
	        <p>加载中</p>
	    </div>
	</div>

	<div class="wrapper">
	    <div class="pages">

	        <! 第一屏 >
	        <section class="page">
	            <div class="ui-form-item ui-form-item-pure ui-border-b">今日课程</div>
	            <div class= "xinqi">
	            	<!-- <div>数据库原理 1--12周 汤蓉 1507</div>

	            	<div></div>
	            	<div></div>
	            	<div></div> -->
	            </div>
	        </section>

	        <! 第二屏 >
	        <section class="page">
	         	<!-- <div class="ui-form-item ui-form-item-pure ui-border-b">所有课程 -->
	         	<!-- </div> -->
	         	<div class="ke" >
	         	</div>
			</section>

	        <! 第三屏 >
	        <section class="page">
			
	            <div class="ui-form-item ui-form-item-pure ui-border-b">
				    <select name="area" class="select area">
				        <option value="本部" selected="">本部</option>
				        <option value="龙泉校区" >龙泉校区</option>
				    </select>
				    <span class="icon icon-down-nav"></span>
				</div>

				<div class="ui-form-item ui-form-item-pure ui-border-b" style="display:none">
				    <select name="mode" class="select mode">
				        <option value="2" selected="">2</option>
				    </select>
				    <span class="icon icon-down-nav"></span>
				</div>

				<div class="local">
					 <div class="ui-form-item ui-form-item-pure ui-border-b">
					    <select name="depart" class="select depart">
				            <option value="成教院" selected=""> 成教院 </option>

				            <option value="大气科学学院"> 大气科学学院 </option>

				            <option value="电子工程学院"> 电子工程学院 </option>

				            <option value="公选"> 公选 </option>

				            <option value="光电技术学院"> 光电技术学院 </option>

				            <option value="计算机学院"> 计算机学院 </option>

				            <option value="控制工程学院"> 控制工程学院 </option>

				            <option value="软件工程学院"> 软件工程学院 </option>

				            <option value="数学学院"> 数学学院 </option>

				            <option value="通信工程学院"> 通信工程学院 </option>

				            <option value="外国语学院"> 外国语学院 </option>

				            <option value="文化艺术学院"> 文化艺术学院 </option>

				            <option value="信息安全工程学院"> 信息安全工程学院 </option>

				            <option value="研究生"> 研究生 </option>

				            <option value="资源环境学院"> 资源环境学院 </option>
					    </select>
					    <span class="icon icon-down-nav"></span>
					</div>
				</div>

				<div class="longquan" style="display:none">
					 <div class="ui-form-item ui-form-item-pure ui-border-b">
					   <select name="depart" class="select depart">
						    <option value="公选" selected=""> 公选 </option>
						    <option value="管理学院"> 管理学院 </option>
						    <option value="商学院"> 商学院 </option>
						    <option value="统计学院"> 统计学院 </option>
						    <option value="外国语学院"> 外国语学院 </option>
						    <option value="文化艺术学院"> 文化艺术学院 </option>
						    <option value="物流学院"> 物流学院 </option>
						    <option value="研究生"> 研究生 </option>
						</select>
					    <span class="icon icon-down-nav"></span>
					</div>
				</div>

				<div class="ui-form-item ui-form-item-pure ui-border-b">
				    <select name="pro" class="select pro">
						<option value="函授大气科学本" selected=""> 函授大气科学本 </option>
				    </select>
				    <span class="icon icon-down-nav"></span>
				</div>
				<div class="ui-form-item ui-form-item-pure ui-border-b">
				    <select name="grade" class="select">
				        <option value="2010级" selected=""> 2010级 </option>
				        <option value="2011级"> 2011级 </option>
				        <option value="2012级"> 2012级 </option>
				        <option value="2013级"> 2013级 </option>
				        <option value="2014级"> 2014级 </option>
				        <option value="2015级"> 2015级 </option>
				    </select>
				    <span class="icon icon-down-nav"></span>
				</div>
				<div class="ui-form-item ui-form-item-pure ui-border-b">
				    <select name="class" class="select">
				        <option value="01班" selected=""> 01班 </option>
				        <option value="02班"> 02班 </option>
				        <option value="03班"> 03班 </option>
				        <option value="04班"> 04班 </option>
				        <option value="05班"> 05班 </option>
				        <option value="06班"> 06班 </option>
				        <option value="07班"> 07班 </option>
				        <option value="08班"> 08班 </option>
				        <option value="09班"> 09班 </option>
				        <option value="10班"> 10班 </option>
				        <option value="11班"> 11班 </option>
				        <option value="12班"> 12班 </option>
				    </select>
				    <span class="icon icon-down-nav"></span>
				</div>

				<div class="ui-form-item ui-form-item-pure ui-border-b search" >查询</div>
				 
	        </section>
	    </div>
	</div>


<!-- <script src="/kebiao/Public/Home/js/zepto.min.js?v=201501248042"></script>
<script src="/kebiao/Public/Home/js/frozen.js"></script>
<script src="/kebiao/Public/Home/js/parallax.js?v=201501248042"></script> -->
<script src="/kebiao/Public/Home/js/zepto.min.js"></script>
<script src="/kebiao/Public/Home/js/frozen.js"></script>
<script src="/kebiao/Public/Home/js/parallax.js"></script>


	<script language="JavaScript">
		$(window).load(function() {
		  loadingHide();
		});

		$(".page").css({"width":$("body").width() + " !important"});
		console.log($("body").width());

		var oArray0;
		var oArray1;
		var oArray2;
		var oArray3;
		var oArray4;
		var oArray5;
		var oArray6;
		var oArray7;
		var oArray8;
		var oArray9;
		var oArray10;
		var oArray11;
		var oArray12;
		var oArray13;
		var oArray14;
		var oArray15;
		var oArray16;
		var oArray17;
		var oArray18;
		var oArray19;
		var oArray20;
		var oArray21;
		var oArray22;
		oArray0 = Array("函授大气科学本");
		oArray1 = Array("大气科学本科", "应用气象学");
		oArray2 = Array("电信（雷电）", "电信(应电)本科", "电子工程本(大气)", "电子工程本科(信息)", "电子信息工程(航电)", "电子信息科技本科", "雷电防护与科学", "生物医学工程本科");
		oArray3 = Array("公选");
		oArray4 = Array("材料物理本科", "电子科学与技术本科", "光电信息科学与工程", "光信息科学与技术本科", "应用物理学本科");
		oArray5 = Array("计算机科学本科(计工)", "计算机科学本科(应用)", "计算机科学与技术本科", "数字媒体技术本科");
		oArray6 = Array("测控技术与仪器本科", "电气工程与自动化本科", "机械电子工程", "自动化（机电）", "自动化本科", "自动化本科(工业)", "自动化本科（数控）");
		oArray7 = Array("空间信息与数字技术", "软件工程本科");
		oArray8 = Array("信息与计算科学本科", "应用数学本科");
		oArray9 = Array("通信工程本科", "微电子学本科");
		oArray10 = Array("测试与评估1", "大学英语3选修", "大学英语4选修", "英语本科");
		oArray11 = Array("对外汉语本科", "汉语国际教育", "汉语言文学本科", "社会工作本科", "视觉(动漫)方向", "视觉(网艺)方向", "视觉传达设计", "艺术设计本科");
		oArray12 = Array("网络工程本科", "网络实验本科", "物联网工程本科", "信安实验本科", "信息安全本科", "信息对抗技术");
		oArray13 = Array("3S集成与气象应用", "大气科学", "电子微系统工程", "电子与通信工程", "管理科学与工程", "环境工程", "环境科学与工程", "基础数学", "集成电路工程", "计算机技术", "计算机应用技术", "农村与区域发展", "农业科技组织与服务", "农业信息化", "农业资源利用", "气象探测技术", "软件工程", "社会工作", "通信与信息系统", "统计学", "物联网技术", "信号与信息处理", "信息安全", "应用经济学", "应用数学", "在职农推");
		oArray14 = Array("测绘工程本科", "地理信息系统本科", "环境工程(卓越)", "环境工程本科", "环境科学本科", "遥感科学与技术本科");

		oArray15 = Array("公选");
		oArray16 = Array("工程管理本科", "公共管理类", "会展经济与管理", "旅游管理本科", "人力资源管理本科", "社会保障方向", "信管本科", "行政管理本科", "行政管理方向");
		oArray17 = Array("ACCA", "财务管理本科", "财务管理本科(理财)", "财务管理本科(税筹)", "国际经济与贸易本科", "会计学(信息)", "会计学本科", "会计学本科(注会)", "金融工程本科", "市场营销本科");
		oArray18 = Array("经济统计", "经统(金保)方向", "经统(政统)方向", "统计学（政府统计）", "统计学本科", "统计学本科（金保本）");
		oArray19 = Array("测试与评估1", "大学英语3选修", "大学英语4选修", "英语本科");
		oArray20 = Array("对外汉语本科", "汉语国际教育", "汉语言文学本科", "社会工作本科", "视觉(动漫)方向", "视觉(网艺)方向", "视觉传达设计", "艺术设计本科");
		oArray21 = Array("电子商务本科", "物流工程本科", "物流管理本科");
		oArray22 = Array("3S集成与气象应用", "大气科学", "电子微系统工程", "电子与通信工程", "管理科学与工程", "环境工程", "环境科学与工程", "基础数学", "集成电路工程", "计算机技术", "计算机应用技术", "农村与区域发展", "农业科技组织与服务", "农业信息化", "农业资源利用", "气象探测技术", "软件工程", "社会工作", "通信与信息系统", "统计学", "物联网技术", "信号与信息处理", "信息安全", "应用经济学", "应用数学", "在职农推");
	</script>

	<script type="text/javascript">
	var result = localStorage["result"];

	if(result){
		result = JSON.parse(result);
		var str = "";
		
	    for (var i = 0; i < 4; i++) {
	    	str = str + '<div class = "container">';
            for (var j = 0; j < 5; j++) {
                // str = str +'<div class ="lay"><div>'+result[j][i]+'</div></div>';   
                str = str +'<div class ="lay">'+result[j][i]+'</div>';   
            }
            str = str +'</div>';
        }
       
	    $(".ke").append(str);
	    var date = new Date().getDay();
	    if (date==0||date==6) {
	        var xinqi = "<div>今天没有课</div>";
	    }else{
	    	console.log(date);
	        var xinqi = "";
	        for (var i = 0; i < 4; i++) {
	         	xinqi = xinqi + "<div>"+result[date-1][i]+"</div>";
	        }
	    }
	    $(".xinqi").append(xinqi);
	}
	

		$('.pages').parallax({
		    direction: 'horizontal',     // horizontal (水平翻页)
		    swipeAnim: 'default',     // cover (切换效果)
		    drag:      true,        // 是否允许拖拽 (若 false 则只有在 touchend 之后才会翻页)
		    loading:   false,        // 有无加载页
		    indicator: false,        // 有无指示点
		    arrow:     false,        // 有无指示箭头
		    /*
		     * 翻页后立即执行
		     * {int}         index: 第几页
		     * {DOMElement} element: 当前页节点
		     * {String}        directation: forward(前翻)、backward(后翻)、stay(保持原页)
		     */
		    onchange: function(index, element, direction) {
		        // code here...
		    },
		    /*
		     * 横竖屏检测
		     * {String}        orientation: landscape / protrait
		     */
		    orientationchange: function(orientation) {
		        // code here...    
		    }
		});
		
		$(".search").on("click",function(){
			loadingShow("正在查询");
			var data = {
			    mode : $("select[name='mode']").val(),
				depart : $("select[name='depart']").val(),
				pro : $("select[name='pro']").val(),
				grade : $("select[name='grade']").val(),
				class : $("select[name='class']").val(),
			}
			console.log(data);
			$.ajax({
	          type : "POST",
	          data: {data:data},
	          dataType: "json",
	          url : "index.php?s=Home/Test/query",
	          success : function(result){
	            console.log(result);
	            console.log(result[1][1]);
	            $(".ke").empty();
	            var resultString = JSON.stringify(result);

	            localStorage.setItem("result",resultString);

	            if(result){
					// result = JSON.parse(result);
					var str = "";
				
				    for (var i = 0; i < 4; i++) {
				    	str = str + '<div class = "container">';
			            for (var j = 0; j < 5; j++) {
			                str = str +'<div id = "lay">'+result[j][i]+'</div>';
			                str = str +'</div>';
			            }
			        }
			       
				    $(".ke").append(str);
				}
	         	location.reload(false);
	          },
	          error: function(error){
	            console.log("error");
	          }
	        });
		})
		$(".area").on("change",function(){
			console.log($("select[name='area']").val());
			if($("select[name='area']").val() == "本部"){
				$(".longquan").hide();
				$(".local").show();

				$(".select[name='depart']").val("成教院");

				$(".pro").empty();
				var str = '<option value="函授大气科学本" selected=""> 函授大气科学本 </option>';
				$(".pro").append(str);
			}else{
				$(".local").hide();
				$(".longquan").show();
				$(".select[name='depart']").val("公选");
				$(".pro").empty();
				var str = '<option value="公选" selected=""> 公选 </option>';
				$(".pro").append(str);
			}
		})
		$(".depart").on("change",function(){
			var depart;
			var array;
			if($("select[name='area']").val() == "本部"){
				console.log($(".local select[name='depart']").val());
				depart = $(".local select[name='depart']").val();
			}else{
				console.log($(".longquan select[name='depart']").val());
				depart = $(".longquan select[name='depart']").val();
			}
			if(depart=="成教院"){
				console.log(oArray0);
				array = oArray0;
			}else if(depart=="大气科学学院"){
				console.log(oArray1);
				array = oArray1;
			}else if(depart=="电子工程学院"){
				console.log(oArray2);
				array = oArray2;
			}else if(depart=="公选"){
				console.log(oArray3);
				array = oArray3;
			}else if(depart=="光电技术学院"){
				console.log(oArray4);
				array = oArray4;
			}else if(depart=="计算机学院"){
				console.log(oArray5);
				array = oArray5;
			}else if(depart=="控制工程学院"){
				console.log(oArray6);
				array = oArray6;
			}else if(depart=="软件工程学院"){
				console.log(oArray7);
				array = oArray7;
			}else if(depart=="数学学院"){
				console.log(oArray8);
				array = oArray8;
			}else if(depart=="通信工程学院"){
				console.log(oArray9);
				array = oArray9;
			}else if(depart=="外国语学院"){
				console.log(oArray10);
				array = oArray10;
			}else if(depart=="文化艺术学院"){
				console.log(oArray11);
				array = oArray11;
			}else if(depart=="信息安全工程学院"){
				console.log(oArray12);
				array = oArray12;
			}else if(depart=="研究生"){
				console.log(oArray13);
				array = oArray13;
			}else if(depart=="资源环境学院"){
				console.log(oArray14);
				array = oArray14;
			}else if(depart=="公选"){
				console.log(oArray15);
				array = oArray15;
			}else if(depart=="管理学院"){
				console.log(oArray16);
				array = oArray16;
			}else if(depart=="商学院"){
				console.log(oArray17);
				array = oArray17;
			}else if(depart=="统计学院"){
				console.log(oArray18);
				array = oArray18;
			}else if(depart=="外国语学院"){
				console.log(oArray19);
				array = oArray19;
			}else if(depart=="文化艺术学院"){
				console.log(oArray20);
				array = oArray20;
			}else if(depart=="物流学院"){
				console.log(oArray21);
				array = oArray21;
			}else if(depart=="研究生"){
				console.log(oArray22);
				array = oArray22;
			}
			var str;
			$(".pro").empty()
			for(var i = 0; i < array.length;i++){
				console.log(array[i]);
				if(i==0){
					str = '<option value="'+array[i]+'" selected=""> '+array[i]+' </option>';
				}else{
					str = str + '<option value="'+array[i]+'"> '+array[i]+' </option>';
				}
			}

			$(".pro").append(str);
			console.log(str);
		})

	function loadingShow(text){
      $("#loading p").text(text);
      $("#loading").addClass("show");
    }

    function loadingHide(){
      $("#loading").removeClass("show");
    }
	</script>

	<script  type="text/javascript">
		$youziku.load(".wrapper", "ef0c4f6471ae42ae9ad376566e027e2f", "Source-Han-Light");
		/*[$youziku.load("#id2", "ef0c4f6471ae42ae9ad376566e027e2f", "Source-Han-Light");]*/
		/*[$youziku.load(".class1", "ef0c4f6471ae42ae9ad376566e027e2f", "Source-Han-Light");]*/
		/*[$youziku.load(".class1", "ef0c4f6471ae42ae9ad376566e027e2f", "Source-Han-Light");]*/
		/*[．．．]*/
		$youziku.draw();
	</script>

</body>
</html>